function redirect() {
  // 重定向 -- 只有一级栏目设置了redirect才有效，并且是绝对路径
  for (let i in asyncRouterMap) {
    let item = asyncRouterMap[i]
    if (item.redirect && item.path === to.path) {
      next({ path: item.redirect })
      break
    }
  }
}
function toPageError(to, routers, parentPath) {
  let isError = true
  for (let i in routers) {
    let item = routers[i]
    if (path.resolve(parentPath || '', item.path) == to.path) {
      return false
    }
    if (item.children) {
      isError = toPageError(to, item.children, item.path)
      if (!isError) {
        return isError
      }
    }
  }
  return isError
}

